<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nginx Configuration Switcher</title>
    <script>
        async function switchToMode(mode) {
            const response = await fetch(`/switch_to_${mode}`, {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                body: JSON.stringify({})
            });
            const data = await response.json();
            document.getElementById('result').innerText = data.message;
        }
    </script>
</head>
<body>
    <h1>Nginx Configuration Switcher</h1>
    <button onclick="switchToMode('maintenance')">Switch to Maintenance Mode</button>
    <button onclick="switchToMode('normal')">Switch to Normal Mode</button>
    <p id="result"></p>
</body>
</html>
